import { getMongoRepository,  } from "typeorm";

import { Colleges } from "../models/Colleges";

class CollegeService {

  // 查找全部
  async findAll() {
    const collegeRepository = getMongoRepository(Colleges);
    return collegeRepository.find()
  }

  // 根据学院名称查询
  async findByCollege(college_name:string) {
    const collegeRepository = getMongoRepository(Colleges);
    return collegeRepository.findOne({college_name})
  }
}

export default new CollegeService()